import {defineStore} from 'pinia'
import {reqChoises,reqVideoCardList,reqVideoClass,reqOfflineClass} from '@/api/discovery/discovery'
let useDiscoveryStore = defineStore('discovery',{
    state:()=>({
        choises:[],
        videoCardList:[],
        video_choises:[],
        offline_choises:[]
    }),
    actions:{
        // 分类卡片数据
      async getChoises(){
        let result = await reqChoises()
        // console.log(result);
        this.choises = result
       },

       //  视频课分类卡片数据
       async getVideoClass(){
        let result = await reqVideoClass()
        // console.log(result)
        this.video_choises = result
       },

       //  线下课分类卡片数据
       async getOfflineClass(){
        let result = await reqOfflineClass()
        console.log(result);
        
        this.offline_choises = result
       }
    //    视频卡片数据
    //    async getVideoCardList(){
    //     let result = await reqVideoCardList()
    //     console.log(result);
    //     // this.choises = result
    //    }
    }
})
export default useDiscoveryStore